home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
batchut
/
enved10.zip
/
ENVED.TXT
< prev
next >
Wrap
Text File
|
1994-07-01
|
11KB
|
262 lines
ENVED
Environment Editor for DOS
Version 1.0
Instructions For Use
-------------------------------------------------------------------------
Copyright (c) 1994 Paul M. Parks
All Rights Reserved
THE AUTHOR, PAUL M. PARKS, DISCLAIMS ALL WARRANTIES RELATING TO THIS
SOFTWARE, WHETHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE AUTHOR OF THIS SOFTWARE WILL NOT BE LIABLE FOR ANY DAMAGES
ARISING FROM THE USE OF OR INABILITY TO USE THIS SOFTWARE.
MS-DOS and Windows are trademarks of the Microsoft Corporation.
OS/2 is a trademark of the IBM Corporation.
NDOS is a trademark of the Symantec Corporation.
-------------------------------------------------------------------------
-- SHAREWARE LICENSE --
The user is granted one license to use this shareware software for a
30-day evaluation period, beginning at the time of first use, for the
express purpose of determining whether or not this software is suitable
for the user's purposes. At the end of this 30-day evaluation period,
the user must either purchase a license for continued use of the
software, or discontinue its use. Any usage beyond this 30-day
evaluation period will be a violation of this license.
This unregistered copy of ENVED may be freely distributed as long as the
files ENVED.EXE, ENVED.TXT, and ENVEDREG.TXT are distributed together
and as long as none of these files have been added to, modified, or
tampered with in any way.
-- INTRODUCTION --
I created ENVED as a means of easily changing environment variables in
MS-DOS and making the changes stick once and for all. Often I would
change an INCLUDE variable, or make a change to my PATH, and then have to
make the change all over again the next time I booted my PC because I had
forgotten to update the variable in my AUTOEXEC.BAT file. With ENVED, I
make a change once and forget about it.
Most users may never have to worry about changing their environment.
However, developers, technicians, and good old-fashioned power users
often have to very carefully manage environment variables and may
frequently need to adjust their values. It is for these users that ENVED
is designed.
-- HOW TO USE ENVED --
Basic Usage - Changing Variables
--------------------------------
Using ENVED is very similar to using the DOS command SET. However, ENVED
will make environment variable changes endure even after the computer is
turned off by updating the corresponding SET command in AUTOEXEC.BAT.
For example, to set the INCLUDE variable, one may type
ENVED INCLUDE C:\LANG\INCLUDE;C:\SOURCE\MYPROJ\INCLUDE;
(Notice that no equals sign is used, as it is in SET). This command line
will set the INCLUDE variable to the value provided, and change any
occurrence of
SET INCLUDE=somevalue
in AUTOEXEC.BAT to
SET INCLUDE=C:\LANG\INCLUDE;C:\SOURCE\MYPROJ\INCLUDE;
Before ENVED makes any changes to AUTOEXEC.BAT it copies your current
file to AUTOEXEC.ENV to preserve your original settings.
If a variable has already been assigned a value, but you want to update
AUTOEXEC.BAT with that value, you may use the /u option to make the
change for you.
ENVED /U NEWVAR
If the variable NEWVAR is not defined in the environment, ENVED will
print a warning to that effect.
Adding Variables
----------------
If the AUTOEXEC.BAT file does not have a SET command for the variable you
specified on the ENVED command line, one will be added to the file. The
first time a variable is added, two comments will be created around the
variable. Every subsequent addition will be made inside these two
comments. For example, if you were to add the TEMP variable to your
AUTOEXEC.BAT file with the value C:\TMP, and you had never added a
variable to your batch file with ENVED before, you would see the
following lines at the end of AUTOEXEC.BAT:
rem ENVED_SET_START
SET TEMP=C:\TMP
rem ENVED_SET_END
Any variables you add afterwards will be inserted just before the
ENVED_SET_END remark line. This can be useful in a couple of ways.
First, if you like to keep all of your environment variable definitions
in one place (a good idea), you can enclose this section of your
AUTOEXEC.BAT file in the above comments. Then, anytime you add a
variable you can be sure that it is in the proper place. Second, if you
are using a boot-up menu to manage different configurations in your
AUTOEXEC.BAT, you can have more than one block of SET statements enclosed
by these remark lines. If you add any new variables, they will be
inserted into each block found in the file. Please remember that the
case of the remark lines is not important, and that both remark lines
must be present and in order before ENVED will recognize the block.
These remarks do not affect the modification of existing SET statements
outside of the markers. ENVED will always search the entire AUTOEXEC.BAT
file for a variable and modify each occurrence.
Removing Variables
------------------
Two methods may be used to remove a variable. One is by using the /x
option to delete the variable from the environment and delete its
reference in AUTOEXEC.BAT. Another method is to use the /r option, which
only remarks the SET command in AUTOEXEC.BAT, but still removes the
variable from the environment. These two options cannot be used
together, nor in conjunction with the /u option.
Specifying The Boot Drive
-------------------------
To change AUTOEXEC.BAT files on drives other than drive C:, use the /d
option followed by a drive letter to tell ENVED where to look for your
AUTOEXEC.BAT file. For example, if you were booting from floppy drive A:
and you wanted to change your PATH variable to "A:\DOS;A:\BIN;A:\;", you
would type the following:
ENVED /DA PATH A:\DOS;A:\BIN;A:\;
This would update A:\AUTOEXEC.BAT with the new path and change your
environment copy of PATH to the new value. This option may also be used
with the /x, /r, and /u options.
Assigning Variables to Variables
--------------------------------
You may include environment variables in the value section of the ENVED
command line (e.g., ENVED USERNAME %USER%). These variables will be
evaluated before being written to the environment, but the SET command in
AUTOEXEC.BAT will be written with the variable name intact. This way,
the value may be evaluated each time AUTOEXEC.BAT is executed. One word
of caution is in order, however: make sure that the variable being
evaluated on the right-hand side of the SET statement is defined before
the variable you are generating is defined.
For example, this is correct:
SET TOOLINC=C:\COOLTOOL\SRC\INCLUDE
SET INCLUDE=C:\LANG\INCLUDE;%TOOLINC%;
This results in an incorrect assignment:
SET INCLUDE=C:\LANG\INCLUDE;%TOOLINC%;
SET TOOLINC=C:\COOLTOOL\SRC\INCLUDE
PATH And PROMPT
---------------
These variables are unique because they may be assigned either by a SET
command or by the DOS commands PATH and PROMPT, respectively. ENVED will
sense which method is used to assign these values in AUTOEXEC.BAT and
update the file accordingly.
-- HOW ENVED WORKS --
The ENVED program changes the DOS environment by creating a temporary
batch file that sets the environment variable and then deletes itself.
This batch file is run as soon as ENVED stops executing. The reason a
batch file is used is that DOS